<cfcomponent extends="base">

<cffunction name="GET" returntype="any" access="public">

<cfinvoke component="data" method="get_reports" returnvariable="get_reports">
<table ><tr><td valign="top" width="75%">

<form action="" method="post" name="delete_practitioner_report">
<table border="1" class="reports_table" cellspacing='0' cellpadding='0' >
<thead >
<tr>
<th width="1%"><input type='checkbox' id="select_all" name='select_all' value='' ></th>
<th width="40%">Report Description</th>
<th width="10%">Email Report</th>
<th width="10%">Date</th>
</tr>
</thead>
<tbody>
<cfif get_reports.recordcount eq 0>
<tr>
<td  ></td>
<td valign="middle">&nbsp; </td>
<td>&nbsp; </td>
<td>&nbsp; </td>
</tr>
</cfif>
<cfloop query="get_reports"><cfoutput>

<tr>
<td  ><input type="hidden" name="delete_selection"id="delete_selection" value="delete_selection">
<input type='checkbox' name='delete_#report_id#'id='delete_#report_id#' value='#report_id#' ></td>
<td valign="middle">#report_description#</td>
<td><a href="/email.cfm?type=report&report_id=#report_id#" target="_blank"><img src="/images/internet-mail.gif" border="0" alt="Send Report - #report_description#" title="Send Report - #report_description#" id="send_report" align="absmiddle" style="cursor:pointer;" /></a></td>
<td>#dateformat(report_date,"dd-mmm-yyyy")#&nbsp;</td>
</tr>
</cfoutput></cfloop>
</tbody>
<tbody>
<tr>
<td colspan="4"><input type="submit" name="submit"id="submit" value="Delete Selected Report" class="button" ></td>
</tr>
</tbody>
</table>
</form>
</td>

<td valign="top" align="right" width="25%">
<table align="center" style="text-align:center;"><tr><td>
<span id="cart_bottom">
<select id="select_report">
<cfloop query="get_reports">
<cfoutput>
<option value="#report_id#">#left(report_description,10)#</option>
</cfoutput>
</cfloop>
</select>&nbsp;<img src="/images/folder-open.png" border="0" alt="View Report" title="View Report" id="report_view_00" align="absmiddle" /><img src="/images/icon_pdf.gif" border="0" alt="View PDF" title="View PDF" id="view_pdf" align="absmiddle" />
</span>
<div class="table_top">
<span class="title_panel">View Report</span>
</div>
<div class="table_content">
<div class="table_text" id="shopping_cart">

</div>
</div>
<div class="table_bottom">
<img src="/images/table_bottom.jpg" width="204" height="23" border="0" alt="" id=""/>
</div>
</td></tr></table>
<br>
</td>


</tr>
</table>
</cffunction>

<cffunction name="POST" returntype="any" access="public">


<cfif isdefined("form.delete_selection")>

<cfinvoke component="data" method="get_reports" returnvariable="get_reports">
<cfloop query="get_reports">
<cfif isdefined("form.delete_" & #get_reports.report_id#)>
<cfquery name="insert_selection" datasource="#Session.dsn#">
delete from five_star_reports WHERE report_id = #get_reports.report_id#;
</cfquery>
<cfelse>
</cfif>
</cfloop>

</cfif>

<cflocation addtoken="no" url="/reports.cfm">
</cffunction>

</cfcomponent>